package org.orbis.communicate;

public class FlagsResult implements Comparable<FlagsResult>{
	private long ID;
	private int newest;
	private boolean[] binaryFlags;
	private int[] intFlags;
	private long[] longFlags;
	private float[] floatFlags;
	
	public FlagsResult(int binFlagLen, int intFlagLen, int longFlagLen, int floatFlagLen) {
		binaryFlags = new boolean[binFlagLen];
		intFlags = new int[intFlagLen];
		longFlags = new long[longFlagLen];
		floatFlags = new float[floatFlagLen];
	}

	public FlagsResult(long ID, int newest, boolean[] binaryFlags, int[] intFlags, long[] longFlags, float[] floatFlags){
		this.ID = ID;
		this.newest = newest;
		this.binaryFlags = binaryFlags;
		this.intFlags = intFlags;
		this.longFlags = longFlags;
		this.floatFlags = floatFlags;
	}
	
	public void setID(long iD){
		ID = iD;
	}

	public long ID(){
		return ID;
	}
	
	public void setNewest(int newest){
		this.newest = newest;
	}
	
	public int newest() {
		return newest;
	}
	
	public void setBinaryFlags(boolean[] binaryFlags){
		this.binaryFlags = binaryFlags;
	}
	
	public boolean[] binaryFlags(){
		return binaryFlags;
	}
	
	public void setIntFlags(int[] intFlags){
		this.intFlags = intFlags;
	}
	
	public int[] intFlags(){
		return intFlags;
	}
	
	public void setLongFlags(long[] longFlags){
		this.longFlags = longFlags;
	}
	
	public long[] longFlags(){
		return longFlags;
	}

	public void setFloatFlags(float[] floatFlags){
		this.floatFlags = floatFlags;
	}
	
	public float[] floatFlags(){
		return floatFlags;
	}
	
	@Override
	public boolean equals(Object obj){
		if(!(obj instanceof FlagsResult)) return false;
		if(((FlagsResult)obj).ID == this.ID) return true;
		return false;
	}
	
	@Override
	public int hashCode(){
		return (int)((ID >> 32) ^ ID);
	}

	@Override
	public int compareTo(FlagsResult arg0){
		if(this.ID < arg0.ID) return 1;
		if(this.ID > arg0.ID) return -1;
		return 0;
	}
}
